﻿using System;
using System.Data;
using System.Collections.Generic;
using Model;
namespace BLL
{
	/// <summary>
	/// PMS_ProjectFinance
	/// </summary>
	public class PMS_ProjectFinanceBLL
	{
		private readonly DAL.PMS_ProjectFinanceDAL dal=new DAL.PMS_ProjectFinanceDAL();
		public PMS_ProjectFinanceBLL()
		{}

        /// <summary>
        /// 根据项目编号查询数据
        /// </summary>
        /// <param name="projectID"></param>
        /// <returns></returns>
        public List<PMS_ProjectFinance> GetList(PMS_ProjectFinanceQuery query)
        {
            return dal.GetList(query);
        }

        /// <summary>
        /// 获得报表数据列表
        /// </summary>
        public DataTable GetListTable(PMS_ProjectFinanceQuery query)
        {
            return dal.GetListTable(query);
        }

        /// <summary>
        /// 根据项目编号查询数据
        /// </summary>
        /// <param name="projectID"></param>
        /// <returns></returns>
        public List<PMS_ProjectFinance> GetList(string projectID)
        {
            return dal.GetList(projectID);
        }

        /// <summary>
        /// 获得单条数据
        /// </summary>
        public PMS_ProjectFinance GetModel(int id)
        {
            return dal.GetModel(id);
        }

        /// <summary>
        /// 新增更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddUpdate(PMS_ProjectFinance model)
        {
            if (model.id <= 0)
            {
                return dal.Add(model);
            }
            else
            {
                return dal.Update(model);
            }
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }
	}
}

